-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Serverless nav] Handle groups and vertical space #169251
[Serverless nav] Handle groups and vertical space #169251
Conversation
…rouping-and-spacing
Pinging @elastic/appex-sharedux (Team:SharedUX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, code review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ML code changes LGTM
It's not possible to test the ML menus as no serverless project is currently using the ML default navigation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-only review. packages/default-nav/analytics/default_navigation.ts
change LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APM changes LGTM
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
History
To update your PR or re-run it, just comment with: cc @sebelga |
In this PR I've updated the Serverless side nav to handle better the different types of groups that we render in the navigation. I've also added a new
spaceBefore
prop to the node definition that allow consumer to customize the space between nodes.If no space is provided the default is: we add a EUI
"m"
space before each of the group at level 1 of the tree. Those are the groups underneath the main collapsible item (with the icon shown when collapsed).Note for reviewers
The best way to test is by openin the "Storybooks Preview" (link in CI status)
Group types -
renderAs
propA group renders differently based on the
renderAs
prop defined. This property accept the following valuesblock
: This is the default is not specified. The group will render as a block of navigation links. No indent. If atitle
is provided then a bold title appears on top of the group.accordion
: As expected, this renders an accordion that can show/hide the links (or nested groups) underneath. Those do have an indent.panelOpener
: This group render as a link + an icon on the right. Clicking on the link opens a landing page. Clicking on the icon opens a panel on the right. The content of the panel can be auto-generated using the same navigation tree definition or a custom component can be provided by the consumer.item
: This group render exactly like any other items in the current list. This is useful if we want to declare descendantchildren
of a node (and have those children nodes appear in the breadcrumb if they match the current URL location) but we don't want it to render as any of the above groups.Screenshots
In the screenshot below, the vertical space between is the default space applied to level 1 groups.
Fixes #167323